package net.crowdloud.client.groups;

import net.crowdloud.shared.entities.Groups;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class UpdateGroups {

	public UpdateGroups(final Groups groups) {

		final GroupsDatabaseServerCallsAsync databaseServerCalls = GWT
				.create(GroupsDatabaseServerCalls.class);

		databaseServerCalls.updateGroups(groups, new AsyncCallback<Void>() {

			public void onSuccess(Void result) {

				new GetGroups();
			}

			public void onFailure(Throwable caught) {
				// Show the RPC error message to the user

			}

		});

	}

}
